//package com.chengyu.core.controller;
//
//import com.zbkj.common.annotation.LogControllerAnnotation;
//import com.zbkj.common.enums.MethodType;
//import com.zbkj.common.page.CommonPage;
//import com.zbkj.common.request.AssistRequest;
//import com.zbkj.common.request.AssistSearchRequest;
//import com.zbkj.common.request.PageParamRequest;
//import com.zbkj.common.response.AssistInfoResponse;
//import com.zbkj.common.response.AssistResponse;
//import com.zbkj.common.result.CommonResult;
//import com.zbkj.service.service.AssistService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiImplicitParam;
//import io.swagger.annotations.ApiImplicitParams;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.access.prepost.PreAuthorize;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//
//
///**
// * 文章管理表 前端控制器
// * +----------------------------------------------------------------------
// * | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// * +----------------------------------------------------------------------
// * | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// * +----------------------------------------------------------------------
// * | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// * +----------------------------------------------------------------------
// * | Author: CRMEB Team <admin@crmeb.com>
// * +----------------------------------------------------------------------
// */
//@Slf4j
//@RestController
//@RequestMapping("api/admin/platform/assist")
//@Api(tags = "文章管理")
//public class AssistController {
//
//    @Autowired
//    private AssistService assistService;
//
//    @PreAuthorize("hasAuthority('platform:assist:list')")
//    @ApiOperation(value = "文章分页列表")
//    @RequestMapping(value = "/list", method = RequestMethod.GET)
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "cid", value = "分类id", dataType = "int"),
//            @ApiImplicitParam(name = "title", value = "标题", dataType = "string"),
//            @ApiImplicitParam(name = "author", value = "作者", dataType = "string")
//    })
//    public CommonResult<CommonPage<AssistResponse>> getList(@Validated AssistSearchRequest request,
//                                                             @Validated PageParamRequest pageParamRequest) {
//        return CommonResult.success(CommonPage.restPage(assistService.getAdminList(request, pageParamRequest)));
//    }
//
//    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "文章新增")
//    @PreAuthorize("hasAuthority('platform:assist:save')")
//    @ApiOperation(value = "文章新增")
//    @RequestMapping(value = "/save", method = RequestMethod.POST)
//    public CommonResult<String> save(@RequestBody @Validated AssistRequest assistRequest) {
//        if (assistService.create(assistRequest)) {
//            return CommonResult.success();
//        }
//        return CommonResult.failed();
//    }
//
//    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除文章")
//    @PreAuthorize("hasAuthority('platform:assist:delete')")
//    @ApiOperation(value = "删除文章")
//    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
//    public CommonResult<String> delete(@PathVariable(value = "id") Integer id) {
//        if (assistService.deleteById(id)) {
//            return CommonResult.success();
//        }
//        return CommonResult.failed();
//    }
//
//    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "文章编辑")
//    @PreAuthorize("hasAuthority('platform:assist:update')")
//    @ApiOperation(value = "文章编辑")
//    @RequestMapping(value = "/update", method = RequestMethod.POST)
//    public CommonResult<String> update(@RequestBody @Validated AssistRequest assistRequest) {
//        if (assistService.updateAssist(assistRequest)) {
//            return CommonResult.success();
//        }
//        return CommonResult.failed();
//    }
//
//    @PreAuthorize("hasAuthority('platform:assist:info')")
//    @ApiOperation(value = "文章详情")
//    @RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
//    public CommonResult<AssistInfoResponse> info(@PathVariable(value = "id") Integer id) {
//        return CommonResult.success(assistService.getDetail(id));
//    }
//
//    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "文章开关")
//    @PreAuthorize("hasAuthority('platform:assist:switch')")
//    @ApiOperation(value = "文章开关")
//    @RequestMapping(value = "/switch/{id}", method = RequestMethod.POST)
//    public CommonResult<String> assistSwitch(@PathVariable("id") Integer id) {
//        if (assistService.assistSwitch(id)) {
//            return CommonResult.success("切换文章开关成功");
//        }
//        return CommonResult.failed("切换文章开关失败");
//    }
//}
//
//
//
